﻿using System.ComponentModel;

namespace TestWizard
{
    public partial class SummaryPage : Wizard.UI.InternalWizardPage
    {
        private readonly CreateUserContext _context;

        public SummaryPage(CreateUserContext context)
        {
            _context = context;

            InitializeComponent();
        }

        private void SummaryPage_SetActive(object sender, CancelEventArgs e)
        {
            userNameLabel.Text = _context.UserName;
            fullNameLabel.Text = _context.FullName;
            descriptionLabel.Text = _context.Description;
            optionsLabel.Text = _context.AdvancedOptions;
        }

        private void SummaryPage_WizardBack(object sender, Wizard.UI.WizardPageEventArgs e)
        {
            if (_context.ShowAdvancedPasswordOptions)
                e.NewPage = "AdvancedPasswordOptionsPage";
            else
                e.NewPage = "PasswordPage";
        }
    }
}
